!/bin/bash

check=$(echo -e "\n" | /usr/bin/telnet {{ip}} 8433 2>/dev/null | grep Connected | wc -l )

if [ $check -lt 1 ];then
  systemctl stop keepalived
fi

#url="http://{{ip}}:88"
#status=$(/usr/bin/curl -s --head "$url" | awk '/HTTP/ {print $2}')
#
#if [ "$status" != "200" ]; then
# systemctl stop keepalived
#fi
